package com.swt.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.swt.entity.Users;
import com.swt.service.UsersService;
@Controller
public class UsersController {
   
	@Autowired
	private UsersService service;
	
   @RequestMapping("/doLogin")
   @ResponseBody
   public Users doLogin(Users users) {
       if(service.doLogin(users)!=null) {
    	   return users;
       }
       return new Users();
   }
   @RequestMapping("/doInsertUsers")
   public String doInsertUsers() {
	   Users users=new Users();
	   users.setUser_code("zhangsan11");
	   users.setPassword("3");
	   System.out.println(service.insertUsers(users));
	   System.out.println(users.getUser_id());
	   return "success";
   }
}
